package by.jtraining.london.web.interceptor;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;

import static by.jtraining.london.constants.Constants.ADMIN;

public class AdminInterceptor extends AbstractUserInterceptor implements Interceptor{

	private static final long serialVersionUID = 7486997591666120549L;

	@Override
	public String intercept(ActionInvocation invocation) throws Exception {
		if(!checkUserRole(invocation, ADMIN)) return INDEX; 
		return invocation.invoke();
	}
}
